package HomeWork.Chapter03;

/**
 * Enjoy programming!!!
 * Time: 2021/11/4 -  20:15
 */
public class PerfectNumber05 {
    public static void main(String[] args){
        int s = 0;
        for (int i = 1; i <= 1000; i++){//i是被判断的数
            for (int j = 1; j < i; j++){//j可能是因子
                if (0 == i % j ) {
                    s += j;
                }
            }
            if (s == i){
                System.out.println(i);
            }
            s = 0;
        }
    }
}
